/*
 * This file is part of aion-engine <aion-engine.com>
 *
 * aion-engine is private software: you can redistribute it and or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Private Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * aion-engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser Public License for more details.
 *
 * You should have received a copy of the GNU Lesser Public License
 * along with aion-engine.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.aionengine.gameserver.model.gameobjects.player;

import com.aionengine.gameserver.model.gameobjects.PersistentState;

/**
 * @author evilset
 */
public class BindPointPosition {

    private int mapId;
    private float x;
    private float y;
    private float z;
    private byte heading;
    private PersistentState persistentState;

    /**
     * @param mapId
     * @param x
     * @param y
     * @param z
     * @param heading
     */
    public BindPointPosition(int mapId, float x, float y, float z, byte heading) {
        this.mapId = mapId;
        this.x = x;
        this.y = y;
        this.z = z;
        this.heading = heading;
        this.persistentState = PersistentState.NEW;
    }

    /**
     * @return Returns the mapId.
     */
    public int getMapId() {
        return mapId;
    }

    /**
     * @return Returns the x.
     */
    public float getX() {
        return x;
    }

    /**
     * @return Returns the y.
     */
    public float getY() {
        return y;
    }

    /**
     * @return Returns the z.
     */
    public float getZ() {
        return z;
    }

    /**
     * @return Returns the heading.
     */
    public byte getHeading() {
        return heading;
    }

    /**
     * @return the persistentState
     */
    public PersistentState getPersistentState() {
        return persistentState;
    }

    /**
     * @param persistentState the persistentState to set
     */
    public void setPersistentState(PersistentState persistentState) {
        switch (persistentState) {
            case UPDATE_REQUIRED:
                if (this.persistentState == PersistentState.NEW)
                    break;
            default:
                this.persistentState = persistentState;
        }
    }
}
